﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace DomainModelDemo.Model
{
    public class Post
    {
        public Guid PostId { get; set; }

        public bool IsPublished { get; set; }

        public string Title { get; set; }

        public string Author { get; set; }

        public string PostContent { get; set; }

        public DateTime PublishDate { get; set; }

        public IList<Comment> Comments { get; set; }

        public string ShortTitle
        {
            get
            {
                return Title.Length > 20 ? Title.Substring(0, 20) + "..." : Title;
            }
        }
        public string ShortContent
        {
            get
            {
                return PostContent.Length > 20 ? PostContent.Substring(0, 100) + "..." : PostContent;
            }
        }
    }
}
